﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Lilium.Web.Mvc
{
	[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
	public class RequiredResourceAttribute: ScriptResourceReferenceAttribute
	{
		public RequiredResourceAttribute(Type reflectedType)
		{
			if (reflectedType == null)
				throw new ArgumentNullException("reflectedType");

			m_ReflectedType = reflectedType;
		}

		public override IEnumerable<IScriptResourceReference> GetResourceReferences()
		{
			return ScriptResourceReflectionHelper.GetResourceReferences(ReflectedType);
		}

		#region private Type ReflectedType

		private readonly Type m_ReflectedType;

		private Type ReflectedType { [System.Diagnostics.DebuggerNonUserCodeAttribute] get { return m_ReflectedType; } }

		#endregion
	}
}
